package com.stox.services.data.downloader.manager.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stox.services.data.downloader.manager.ExchangeDownloadMetadataManager;
import com.stox.services.data.downloader.model.ExchangeDownloadMetadata;
import com.stox.services.data.downloader.repository.ExchangeDownloadMetadataRepository;

@Component
public class ExchangeDownloadMetadataManagerImpl implements ExchangeDownloadMetadataManager{

	@Autowired
	private ExchangeDownloadMetadataRepository exchangeDownloadMetadataRepository;
	
	@Override
	public ExchangeDownloadMetadata findOne(Long exchangeId) {
		return exchangeDownloadMetadataRepository.findOne(exchangeId);
	}

	@Override
	public void save(ExchangeDownloadMetadata exchangeDownloadMetadata) {
		exchangeDownloadMetadataRepository.saveAndFlush(exchangeDownloadMetadata);
	}

}
